package cn.stimd.spring.context;

import cn.stimd.spring.beans.factory.config.BeanFactoryPostProcessor;
import cn.stimd.spring.beans.factory.config.ConfigurableBeanFactory;
import cn.stimd.spring.context.event.ApplicationListener;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
public interface ConfigurableApplicationContext extends ApplicationContext {

    void addBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor);
    void addApplicationListener(ApplicationListener<?> listener);
    void refresh();
    void close();
    void setEnvironment(ConfigurableEnvironment environment);
    ConfigurableBeanFactory getBeanFactory() throws IllegalStateException;
    void setParent(ApplicationContext parent);
    /**
     * 向虚拟机注册一个关闭钩子（需要外部手动调用该方法，比如SpringBoot）
     */
    void registerShutdownHook();
}
